<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="error_Page.jsp" %>
<%!
	String sid,sname;
	Connection conn=null;
	Statement stmt=null;
	ResultSet rs=null;	
%>
<% 
	sid=(String)session.getAttribute("id");
	sname=(String)session.getAttribute("name");
	if(sid==null)
	response.sendRedirect("http://localhost:8080/expired.html");
	else
try{
    	sid=request.getParameter("T1");
   	Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
	conn=DriverManager.getConnection("jdbc:odbc:sis");
	stmt=conn.createStatement();
	String Query="DELETE * FROM Student WHERE SID='"+sid+"'";
    int chk=stmt.executeUpdate(Query);
	if(chk==1)
	out.println("Student has been Deleted Successfully!");
	else
	out.println("Failed to Delete Student");
}
	catch(Exception e){
		out.println("Exception has been Occured"+e.getMessage());
	}
 %>
<html>
<head>
<title>Redirecting You to Main Page</title>
<meta http-equiv="refresh"  content="3 ; url=AdminSIS.jsp">
</head>
<body>

<p><strong><font color="#999999" face="Courier New, Courier, mono">Redirecting 
you to Home Page</font></strong> </p>
<p align="center">
<img border="0" src="images/redirect.JPG" width="200" height="250"></p>
<p>&nbsp;</p>

</body>
</html>
